﻿using DI;
using Core.Context;
using StructureMap;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tests.Helpers
{
    public static class CurrentContextHelper
    {
        public static void Logon()
        {
            ICurrentContext currentContext = Bootstrapper.Resolve<ICurrentContext>();
            Fakes.FakeCurrentContext operatorContext = new Fakes.FakeCurrentContext(true, new List<string>() {"Operator"});
            operatorContext.Culture = "en-GB";
            operatorContext.UserId = "5f76d04b-8146-4e1b-96df-0dd92fd43aae";
            operatorContext.UserName = "demo";
            Bootstrapper.Container.Configure(x =>
            {
                x.For<ICurrentContext>().Use(operatorContext).Singleton();
            });                        
        }
    }
}
